Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@unified-latex/unified-latex-util-pgfkeys
Advanced tools
Functions for manipulating pgfkeys-like arguments in a unified-latex AST
Functions to help manipulate unified-latex
Abstract Syntax Tree (AST) that contain
pgfkeys-style arguments. Note that pgfkeys aren't built into Ast.Ast
. Instead, parsing
nodes as pgfkeys will produce a new (incompatible) AST.
If you want to parse or manipulate macros/environments with pgfkeys-style arguments.
npm install @unified-latex/unified-latex-util-pgfkeys
This package contains both esm and commonjs exports. To explicitly access the esm export,
import the .js
file. To explicitly access the commonjs export, import the .cjs
file.
createMatchers()
function createMatchers(): { isChar: (node: Ast.Node, char: string) => node is Ast.String; isComma: (node: Ast.Node) => node is Ast.String; isEquals: (node: Ast.Node) => node is Ast.String; isWhitespace: (node: Ast.Node) => node is Ast.Whitespace; isParbreak: (node: Ast.Node) => node is Ast.Parbreak; isSameLineComment: (node: Ast.Node) => boo...
parsePgfkeys(ast, options)
Parse the arguments of a Pgfkeys macro. The ast
is expected to be a comma separated list of Item
s.
Each item can have 0 or more item parts, which are separated
by "=". If itemPart
is undefined,
If options.allowParenGroups === true
, then commas that occur inside groups of parenthesis
will not be parsed as separators. This is useful for parsing tikz \foreach
loops.
function parsePgfkeys(
ast: Ast.Node[],
options: { allowParenGroups: boolean }
): Item[];
Parameters
Param | Type |
---|---|
ast | Ast.Node[] |
options | Omitted |
pgfkeysArgToObject(arg)
Parse arg
as pgfkeys and return a JavaScript object with the results.
The keys will be normalized to strings and the values will be arrays of nodes.
function pgfkeysArgToObject(
arg: Ast.Node[] | Ast.Argument
): Record<string, Ast.Node[]>;
Parameters
Param | Type |
---|---|
arg | Ast.Node[] | Ast.Argument |
Item
export type Item = {
itemParts?: Ast.Node[][];
trailingComment: Ast.Comment | null;
trailingComma?: boolean;
leadingParbreak?: boolean;
};
FAQs
Functions for manipulating pgfkeys-like arguments in a unified-latex AST
We found that @unified-latex/unified-latex-util-pgfkeys demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.